package com.mxpio.erp.common.workshop.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mxpio.erp.common.jpa.model.Order;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_WORKSHOP_MO")
@ApiModel(value="生产订单")
public class ManufactureOrder extends Order {

	private static final long serialVersionUID = 1L;

	@Column(name = "PRODUCT_ITEM_CODE_")
	@ApiModelProperty(value = "产品编号")
	private String productItemCode;
	
	@Column(name = "PRODUCT_ITEM_NAME_")
	@ApiModelProperty(value = "产品名称")
	private String productItemName;

	@Column(name = "ORDER_QANTITY_")
	@ApiModelProperty(value = "订单数量")
	private String orderQuantity;

	@Column(name = "MAIN_WORKSHOP_")
	@ApiModelProperty(value = "主制车间")
	private String mainWorkshop;

	@Column(name = "PROCESS_ROUTE_")
	@ApiModelProperty(value = "工艺路线")
	private String processRoute;

	@Column(name = "REFERENCE_DATE_")
	@ApiModelProperty(value = "参考日期")
	private Date referenceDate;

	@Column(name = "START_DATE_")
	@ApiModelProperty(value = "计划开始日期")
	private Date startDate;

	@Column(name = "PLANNER_")
	@ApiModelProperty(value = "计划员")
	private String planner;
	
	@Column(name = "END_DATE")
	@ApiModelProperty(value = "计划完成日期")
	private Date endDate;
	
	@Column(name = "MEMO_")
	@ApiModelProperty(value = "备注")
	private String memo;

	@Transient
	private List<ManufactureOrderItem> manufactureOrderItems;

	@Override
	public String initTypeCode() {
		return "MO1";
	}
}
